package com.software.car.controller;

import com.software.car.common.utils.CommonResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.HashMap;

/**
 * @Author 魔法はまだ解けない
 * @Date 2021/2/23
 */
@RestController
@RequestMapping("/example")
public class ExampleController {

    /**
     *  获取实例数据及实例模板列表
     * @return
     */
    @GetMapping("")
    public CommonResult getExample(){

        HashMap<String, Object> resultMap = new HashMap<>();


        ArrayList<HashMap<String, Object>> hashMaps = new ArrayList<>();
        for (int i = 0; i < 20; i++) {
            HashMap<String, Object> hashMap = new HashMap<>();
            hashMap.put("name","选项1");
            hashMap.put("age","sb");
            hashMap.put("sex","男");
            hashMaps.add(hashMap);
        }
        resultMap.put("message",hashMaps);
        return CommonResult.success(resultMap);
    };
}
